home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / pvconfig.cpp < prev    next >
C/C++ Source or Header  |  1998-01-05  |  2KB  |  65 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVCONFIG.CPP                         |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Startup configuration manager        |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. #define uses_stdio
  16. #define uses_string
  17. #define uses_comlin
  18. #define uses_config
  19. #define uses_ini
  20. #define uses_system
  21.  
  22. #define _DECLARE_PVCONFIG
  23. #include "PVuses.h"
  24. #undef  _DECLARE_PVCONFIG
  25.  
  26. #ifndef NOCONFIG
  27.  
  28. #define EC_BAD_INIFILE 221
  29.  
  30. void __init_config( void )
  31. {
  32. #ifndef NOPARAM
  33.   if( param_spec( "/INI:", config_filename ) )
  34.   {
  35.     add_ext( config_filename, ".INI" );
  36.     if( read_ini( min_path(fexpand(config_filename)) ) == NULL )
  37.     {
  38. #ifdef CYR
  39.       printf( "â░Ñ╕¬á: ìÑ│»Ñ╕¡« »░«╖Ñ▓Ñ¡ ┤á⌐½ %s\n", config_filename );
  40. #else
  41.       printf( "Error: Can't read INI file %s\n", config_filename );
  42. #endif
  43.       exit( EC_BAD_INIFILE );
  44.     }
  45.   }
  46.   else
  47. #endif
  48.   {
  49.     char *filename =
  50.   #ifdef INIFILE
  51.       INIFILE;
  52.   #else
  53.       CONFIG_FILENAME;
  54.   #endif
  55.     read_ini( min_path(fexpand(strcpy(config_filename,filename))) );
  56.   }
  57. }
  58.  
  59. void __tini_config( void )
  60. {
  61.   close_ini();
  62. }
  63.  
  64. #endif //NOCONFIG
  65.